package org.xlin.biz.service.menu;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.xlin.biz.dao.menu.MenuDao;

/**
 * 
 * 菜单管理逻辑处理类
 * @author xl
 *
 */
@Service
public class MenuService {
	
	@Resource
	MenuDao menuDao;
	
	/**
	 * 分页查询菜单列表
	 * @param pageable
	 * @param condition
	 * @return
	 */
	public Page<Map<String, ?>> queryRecord4Page(Pageable pageable, Map<String, Object> condition){
		return menuDao.queryRecord4Page(pageable, condition);
	}
	
	/**
	 * 增加菜单
	 * @param condition
	 * @return
	 */
	public void addRecord(Map<String,Object> condition){
		menuDao.addRecord(condition);
	}
	
	/**
	 * 更新菜单
	 * @param condition
	 * @return
	 */
	public int modfiyRecord(Map<String,Object> condition){
		return menuDao.modfiyRecord(condition);
	}
	
	/**
	 * 删除菜单
	 * @param condition
	 * @return
	 */
	public void deleteRecord(Map<String,Object> condition){
		menuDao.deleteRecord(condition);
	}
	
	/**
	 * 查询就餐记录的点餐单
	 * @param repastId
	 * @return
	 */
	public List<Map<String,Object>> queryMenusByRepastId(int repastId){
		return menuDao.queryMenusByRepastId(repastId);
	}
	
	/**
	 * 查询所有菜单
	 * @return
	 */
	public List<Map<String,Object>> queryAllMenus4LoadSels(){
		return menuDao.queryAllMenus4LoadSels();
	}
}
